<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class PayRecord
 * @package App\Models
 * @version September 18, 2017, 5:17 pm UTC
 *
 * @property decimal amount
 * @property string channel
 * @property string out_trade_no
 * @property string extra_param
 * @property string trade_state
 * @property string transaction_id
 * @property string payer_openid
 * @property integer payer_id
 * @property string notify_data
 * @property timestamp notify_at
 */
class PayRecord extends Model
{
    use SoftDeletes;

    public $table = 'pay_records';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'order_id',
        'amount',
        'return_amount',
        'channel',
        'out_trade_no',
        'extra_param',
        'trade_state',
        'transaction_id',
        'payer_openid',
        'payer_id',
        'notify_data',
        'notify_at'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
//    protected $casts = [
//        'channel' => 'string',
//        'out_trade_no' => 'string',
//        'extra_param' => 'string',
//        'trade_state' => 'string',
//        'transaction_id' => 'string',
//        'payer_openid' => 'string',
//        'payer_id' => 'integer',
//        'notify_data' => 'string'
//    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    public function order()
    {
        return $this->belongsTo('App\Models\Order');
    }
}
